package com.rsk.dao;

import com.rsk.entity.SysCompanyContacts;
import com.rsk.entity.SysCompanyTypes;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.io.Serializable;


@Repository
public interface SysCompanyContactsRepository extends JpaRepository<SysCompanyContacts, Long>,JpaSpecificationExecutor<SysCompanyContacts>,Serializable {


    @Modifying
    @Query(value = "update sys_company_contacts set is_del = 1, operator_user =?2, operator_time = NOW() where id =?1", nativeQuery = true)
    public int delSysCompanyContacts(Long id, Long operatorUser);

    @Modifying
    @Query(value = "update sys_company_contacts set company_Id = ?2, contacts_name =?3, operator_user =?4,contacts_Phone =?5,contacts_Post =?6,remarks =?7,operator_time = NOW() where id =?1", nativeQuery = true)
    public int updateSysCompanyContacts(Long id, Long companyId, String contactsName, String contactsPhone,
                                        String contactsPost, String remarks, Long operatorUser,Integer mainResponsiable);

}
